import service from '@/utils/request'

export function sendCodeService(phone) {
  return service({
    url: '/portal/user/send_code',
    method: 'get',
    params: { phone }
  })
}

export function codeLoginService(params = {}) {
  return service({
    url: '/portal/user/login/code',
    method: 'post',
    data: params
  })
}

export function logoutService() {
  return service({
    url: '/portal/user/logout',
    method: 'delete'
  })
}

export function getUserInfoService() {
  return service({
    url: '/portal/user/login_info/get',
    method: 'get'
  })
}

export function editUserService(params = {}) {
  return service({
    url: '/portal/user/edit',
    method: 'post',
    data: params
  })
}

export function updateHeadImageService(params = {}) {
  return service({
    url: '/portal/user/head-image/update',
    method: 'put',
    data: params
  })
}

export function userSubmitService(params = {}) {
  return service({
    url: '/portal/user/question/rabbit/submit',
    method: 'post',
    data: params
  })
}
